package cn.ac.zing.server.hj212.test;

import cn.ac.zing.server.util.FileUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.ClassUtils;

import java.io.File;
import java.io.InputStream;

/**
 * @Author：dcy
 * @name：MakeData
 * @Date：2024/5/21 16:47
 */
public class MakeData {

    public void makeData() throws Exception {
        String postFile = "demo/post.json";
        InputStream in = this.getClass().getClassLoader().getResourceAsStream(postFile);
        String configString = FileUtil.getFileContent(in);
        JSONArray json = JSONArray.parseArray(configString);

        for (Object object : json) {
            new LoopSend((JSONObject) object).start();
        }

    }

    public static void main(String[] args) throws Exception {
        new MakeData().makeData();
    }
}
